package com.zdlt.admin.api.mapper;

import com.zdlt.admin.api.domain.Follow;
import com.zdlt.admin.api.domain.SystemUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FollowMapper {
    List<SystemUser> page(
            @Param("userId") Long userId,
            @Param("pageIndex") Integer pageIndex,
            @Param("pageSize") Integer pageSize);

    int count(@Param("userId") Long userId);

    List<Long> allFollowed(@Param("userId") Long userId);

    int relationship(@Param("userId") Long userId, @Param("fanId") Long fanId);

    /**
     * 关注
     *
     * @param follow
     * @return
     */
    int insert(Follow follow);

    /**
     * 取消关注
     *
     * @param userId
     * @param fanId
     */
    void unFollow(@Param("userId") Long userId, @Param("fanId") Long fanId);
}
